package com.anysoft.web;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.webkit.WebView;

import com.anysoft.me.base.BaseWebViewActivity;
import com.anysoft.utils.CommonUtil;
import com.anysoft.utils.StringUtils;


/**
 * Created by lty on 2017/11/9.
 * 了解XXXXXX
 */

public class IcbcDetailActivity extends BaseWebViewActivity {

    private String content, icbcUrl;

    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        isShowTitleBar(true);
        title.setText("了解XXXXXX");
        content = getIntent().getStringExtra("content");
        icbcUrl = getIntent().getStringExtra("icbcUrl");

        if (!StringUtils.isNullOrEmpty(icbcUrl)) {
            String params = "?";
            if (icbcUrl.contains("?")) {
                params = "&";
            }
            loadUrl = icbcUrl + params + "isFromApp=true";
        } else if (!StringUtils.isNullOrEmpty(content)) {
            loadUrl = content;
        }
        if (CommonUtil.isNetWorkConnected(this)) {
            setWebViewConfig(loadUrl);
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
    }

    public void onshouldOverrideUrlLoadingCallBack(WebView view, String url) {
        view.loadUrl(url);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }
}
